import * as React from 'react';
import { NavLink } from 'react-router-dom';
import "./mainHeader.scss"

import History from "src/history/index";

import Logo from "src/components/Logo/logo";
import Login from "src/components/Login/Login";
import Msg from "src/components/Msg/Msg";
import { Input,Icon } from 'antd';
const { Search } = Input;

interface IMyStateType{
  focused:number
}

class MainHeader extends React.Component<any,IMyStateType>{
  constructor(props:any){
    super(props);
    this.state = {focused: 1111};
  }
  private onSearch=(value:string)=>{
    console.log(value);
  }
  public render() {
    
    return (
      <div className="MainHeader">
          <div className="base-container navs">
              <Logo />
              <ul className="navitem">
                <li><NavLink exact={true} to="/" activeClassName="active">首页</NavLink></li>
                <li>新闻</li>
                <li>问题</li>
                <li>下载</li>
                <li>招聘</li>
                <li>VIP</li>
              </ul>
              <div className="searchs">
              <Search
                placeholder="搜索问题或关键字"
                onSearch={this.onSearch}
                style={{ width: 200 }}
              />
              </div>
              <div className="write" onClick={()=>{
                History.push("/self/boke/write/123456")
              }}>
              <Icon type="font-size" />写博客
              </div>
              <Msg />
              <Login/>
          </div>
      </div>
    );
  }
}

export default MainHeader;
